﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.Unity;
using Skynet.WebAdministracion.Views.OrganizationMgmView;

namespace Skynet.WebSite.Administration
{
    public partial class OrganizationMgmView : WebFoundation.Views.Page,  WebAdministracion.Views.OrganizationMgmView.IOrganizationMgmView
    {
        private OrganizationMgmPresenter _Presenter;
        [Dependency]
        public OrganizationMgmPresenter Presenter
        {
            get { return _Presenter; }
            set
            {
                _Presenter = value;
                this._Presenter.View = this;
            }
        }
      

        protected void Page_Load(object sender, EventArgs e)
        {
            this.odsOrganizations.ObjectCreating += delegate(object ocds, ObjectDataSourceEventArgs args) { args.ObjectInstance = this.Presenter; };
            this.odsWorkOrganization.ObjectCreating += delegate(object ocds, ObjectDataSourceEventArgs args) { args.ObjectInstance = this.Presenter; };
        }

        protected void gvOrganizations_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.dvorganization.ChangeMode(DetailsViewMode.Edit);       
        }
    }
}